const router = require("koa-router")()
const sequelize = require("../mysqlconnect.js")
const {QueryTypes} = require("sequelize")
router.prefix("/category")
router.get('/findByPid',async (ctx,next)=>{
	const pid = ctx.query.pid
	const res = await sequelize.query(`select * from category where pid=${pid}`,{type:QueryTypes.SELECT})
	ctx.body = {code:200,data:res}
})
module.exports = router